# While循环
i = 1
sum = 0
while i <= 5:
  sum += i
  i += 1
else:
  print("i的值为：",i)
print("1到5的数字之和:",sum)
# for循环
for i in range(1,6):
  print(i)
else:
  print("循环结束")

print("打印字母")
word = 'school'
for letter in word:
  print(letter)

#break 和 continue语句以及循环中的else语句
while True:
  print("while 循环开始")
  break
print("循环结束")

print ("for 循环开始")
for i in range(1,4):
  if i == 3:
    break
  print(i)
else:
  print("循环结束")



for letter in "school":
  if letter == "h":
    continue
  print('字面为h时跳过',letter)

# pass 语句
for letter in "school":
  if letter == "o":
    pass
    print('执行pass块')
  print('当前字母',letter)
 
